.class Lorg/zeam/Launcher$AddDialog;
.super Ljava/lang/Object;
.source "Launcher.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;
.implements Landroid/content/DialogInterface$OnCancelListener;
.implements Landroid/content/DialogInterface$OnDismissListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/zeam/Launcher;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "AddDialog"
.end annotation


# instance fields
.field private mAdapter:Lorg/zeam/AddDialogAdapter;

.field final synthetic this$0:Lorg/zeam/Launcher;


# direct methods
.method private constructor <init>(Lorg/zeam/Launcher;)V
    .locals 0
    .parameter

    .prologue
    .line 2257
    iput-object p1, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lorg/zeam/Launcher;Lorg/zeam/Launcher$AddDialog;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 2257
    invoke-direct {p0, p1}, Lorg/zeam/Launcher$AddDialog;-><init>(Lorg/zeam/Launcher;)V

    return-void
.end method

.method private cleanup()V
    .locals 2

    .prologue
    .line 2289
    iget-object v0, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v0}, Lorg/zeam/Launcher;->access$5(Lorg/zeam/Launcher;)Lorg/zeam/Workspace;

    move-result-object v0

    invoke-virtual {v0}, Lorg/zeam/Workspace;->unlock()V

    .line 2290
    iget-object v0, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Lorg/zeam/Launcher;->dismissDialog(I)V

    .line 2291
    return-void
.end method


# virtual methods
.method createDialog()Landroid/app/Dialog;
    .locals 5

    .prologue
    const/4 v4, 0x1

    .line 2265
    iget-object v2, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v2, v4}, Lorg/zeam/Launcher;->access$0(Lorg/zeam/Launcher;Z)V

    .line 2266
    new-instance v2, Lorg/zeam/AddDialogAdapter;

    iget-object v3, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-direct {v2, v3}, Lorg/zeam/AddDialogAdapter;-><init>(Lorg/zeam/Launcher;)V

    iput-object v2, p0, Lorg/zeam/Launcher$AddDialog;->mAdapter:Lorg/zeam/AddDialogAdapter;

    .line 2267
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v2, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-direct {v0, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 2268
    .local v0, builder:Landroid/app/AlertDialog$Builder;
    iget-object v2, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const v3, 0x7f0a004e

    invoke-virtual {v2, v3}, Lorg/zeam/Launcher;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 2269
    invoke-virtual {v0, v4}, Landroid/app/AlertDialog$Builder;->setInverseBackgroundForced(Z)Landroid/app/AlertDialog$Builder;

    .line 2270
    iget-object v2, p0, Lorg/zeam/Launcher$AddDialog;->mAdapter:Lorg/zeam/AddDialogAdapter;

    invoke-virtual {v0, v2, p0}, Landroid/app/AlertDialog$Builder;->setAdapter(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 2272
    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v1

    .line 2273
    .local v1, dialog:Landroid/app/AlertDialog;
    invoke-virtual {v1, p0}, Landroid/app/AlertDialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 2274
    invoke-virtual {v1, p0}, Landroid/app/AlertDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

    .line 2275
    return-object v1
.end method

.method public onCancel(Landroid/content/DialogInterface;)V
    .locals 2
    .parameter "dialog"

    .prologue
    .line 2279
    iget-object v0, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lorg/zeam/Launcher;->access$0(Lorg/zeam/Launcher;Z)V

    .line 2280
    invoke-direct {p0}, Lorg/zeam/Launcher$AddDialog;->cleanup()V

    .line 2281
    return-void
.end method

.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 12
    .parameter "dialog"
    .parameter "which"

    .prologue
    .line 2295
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-virtual {v9}, Lorg/zeam/Launcher;->getResources()Landroid/content/res/Resources;

    move-result-object v6

    .line 2296
    .local v6, res:Landroid/content/res/Resources;
    invoke-direct {p0}, Lorg/zeam/Launcher$AddDialog;->cleanup()V

    .line 2298
    packed-switch p2, :pswitch_data_0

    .line 2356
    :goto_0
    return-void

    .line 2300
    :pswitch_0
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v10, 0x7

    const v11, 0x7f0a0071

    invoke-static {v9, v10, v11}, Lorg/zeam/Launcher;->access$11(Lorg/zeam/Launcher;II)V

    goto :goto_0

    .line 2305
    :pswitch_1
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v9}, Lorg/zeam/Launcher;->access$12(Lorg/zeam/Launcher;)Lorg/zeam/LauncherAppWidgetHost;

    move-result-object v9

    invoke-virtual {v9}, Lorg/zeam/LauncherAppWidgetHost;->allocateAppWidgetId()I

    move-result v0

    .line 2306
    .local v0, appWidgetId:I
    new-instance v5, Landroid/content/Intent;

    const-string v9, "android.appwidget.action.APPWIDGET_PICK"

    invoke-direct {v5, v9}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2307
    .local v5, pickIntent:Landroid/content/Intent;
    const-string v9, "appWidgetId"

    invoke-virtual {v5, v9, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 2309
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 2310
    .local v4, customInfo:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/appwidget/AppWidgetProviderInfo;>;"
    new-instance v1, Landroid/appwidget/AppWidgetProviderInfo;

    invoke-direct {v1}, Landroid/appwidget/AppWidgetProviderInfo;-><init>()V

    .line 2311
    .local v1, appWidgetProviderInfo:Landroid/appwidget/AppWidgetProviderInfo;
    new-instance v9, Landroid/content/ComponentName;

    iget-object v10, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-virtual {v10}, Lorg/zeam/Launcher;->getPackageName()Ljava/lang/String;

    move-result-object v10

    const-string v11, "XXX.YYY"

    invoke-direct {v9, v10, v11}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v9, v1, Landroid/appwidget/AppWidgetProviderInfo;->provider:Landroid/content/ComponentName;

    .line 2312
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const v10, 0x7f0a005c

    invoke-virtual {v9, v10}, Lorg/zeam/Launcher;->getString(I)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v1, Landroid/appwidget/AppWidgetProviderInfo;->label:Ljava/lang/String;

    .line 2313
    const v9, 0x7f020016

    iput v9, v1, Landroid/appwidget/AppWidgetProviderInfo;->icon:I

    .line 2314
    invoke-virtual {v4, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 2315
    const-string v9, "customInfo"

    invoke-virtual {v5, v9, v4}, Landroid/content/Intent;->putParcelableArrayListExtra(Ljava/lang/String;Ljava/util/ArrayList;)Landroid/content/Intent;

    .line 2323
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 2324
    .local v3, customExtras:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/os/Bundle;>;"
    new-instance v2, Landroid/os/Bundle;

    invoke-direct {v2}, Landroid/os/Bundle;-><init>()V

    .line 2326
    .local v2, bundle:Landroid/os/Bundle;
    const-string v9, "custom_widget"

    const-string v10, "search_widget"

    invoke-virtual {v2, v9, v10}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 2327
    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 2328
    const-string v9, "customExtras"

    invoke-virtual {v5, v9, v3}, Landroid/content/Intent;->putParcelableArrayListExtra(Ljava/lang/String;Ljava/util/ArrayList;)Landroid/content/Intent;

    .line 2329
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const/16 v10, 0x9

    invoke-virtual {v9, v5, v10}, Lorg/zeam/Launcher;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_0

    .line 2334
    .end local v0           #appWidgetId:I
    .end local v1           #appWidgetProviderInfo:Landroid/appwidget/AppWidgetProviderInfo;
    .end local v2           #bundle:Landroid/os/Bundle;
    .end local v3           #customExtras:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/os/Bundle;>;"
    .end local v4           #customInfo:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/appwidget/AppWidgetProviderInfo;>;"
    .end local v5           #pickIntent:Landroid/content/Intent;
    :pswitch_2
    new-instance v2, Landroid/os/Bundle;

    invoke-direct {v2}, Landroid/os/Bundle;-><init>()V

    .line 2335
    .restart local v2       #bundle:Landroid/os/Bundle;
    new-instance v8, Ljava/util/ArrayList;

    invoke-direct {v8}, Ljava/util/ArrayList;-><init>()V

    .line 2336
    .local v8, shortcutNames:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    const v9, 0x7f0a005d

    invoke-virtual {v6, v9}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 2337
    const-string v9, "android.intent.extra.shortcut.NAME"

    invoke-virtual {v2, v9, v8}, Landroid/os/Bundle;->putStringArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V

    .line 2339
    new-instance v7, Ljava/util/ArrayList;

    invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V

    .line 2340
    .local v7, shortcutIcons:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/content/Intent$ShortcutIconResource;>;"
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const v10, 0x7f020011

    invoke-static {v9, v10}, Landroid/content/Intent$ShortcutIconResource;->fromContext(Landroid/content/Context;I)Landroid/content/Intent$ShortcutIconResource;

    move-result-object v9

    invoke-virtual {v7, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 2341
    const-string v9, "android.intent.extra.shortcut.ICON_RESOURCE"

    invoke-virtual {v2, v9, v7}, Landroid/os/Bundle;->putParcelableArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V

    .line 2343
    new-instance v5, Landroid/content/Intent;

    const-string v9, "android.intent.action.PICK_ACTIVITY"

    invoke-direct {v5, v9}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2344
    .restart local v5       #pickIntent:Landroid/content/Intent;
    const-string v9, "android.intent.extra.INTENT"

    new-instance v10, Landroid/content/Intent;

    const-string v11, "android.intent.action.CREATE_LIVE_FOLDER"

    invoke-direct {v10, v11}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, v9, v10}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 2345
    const-string v9, "android.intent.extra.TITLE"

    iget-object v10, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const v11, 0x7f0a0072

    invoke-virtual {v10, v11}, Lorg/zeam/Launcher;->getText(I)Ljava/lang/CharSequence;

    move-result-object v10

    invoke-virtual {v5, v9, v10}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/CharSequence;)Landroid/content/Intent;

    .line 2346
    invoke-virtual {v5, v2}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    .line 2348
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    const/16 v10, 0x8

    invoke-virtual {v9, v5, v10}, Lorg/zeam/Launcher;->startActivityForResult(Landroid/content/Intent;I)V

    goto/16 :goto_0

    .line 2352
    .end local v2           #bundle:Landroid/os/Bundle;
    .end local v5           #pickIntent:Landroid/content/Intent;
    .end local v7           #shortcutIcons:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/content/Intent$ShortcutIconResource;>;"
    .end local v8           #shortcutNames:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    :pswitch_3
    iget-object v9, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v9}, Lorg/zeam/Launcher;->access$13(Lorg/zeam/Launcher;)V

    goto/16 :goto_0

    .line 2298
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method public onDismiss(Landroid/content/DialogInterface;)V
    .locals 1
    .parameter "dialog"

    .prologue
    .line 2284
    iget-object v0, p0, Lorg/zeam/Launcher$AddDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v0}, Lorg/zeam/Launcher;->access$5(Lorg/zeam/Launcher;)Lorg/zeam/Workspace;

    move-result-object v0

    invoke-virtual {v0}, Lorg/zeam/Workspace;->unlock()V

    .line 2285
    return-void
.end method
